package com.github.caijinglong.tempExec

import java.io.File

fun main(args: Array<String>) {
    val input = File("./f/temp.txt").inputStream().bufferedReader()
    val sb = StringBuilder()
    input.lines().forEach {
        if (it.contains("眉鉬").not()) {
            sb.appendln(it)
        }
    }

    val days = arrayListOf<List<String>>()

    val lines = sb.split("\n")

    var list = arrayListOf<String>()

    days.add(list)
    lines.forEachIndexed { index, str ->
        if (str.trim().isEmpty()) {
            list = ArrayList()
            days.add(list)
        } else {
            list.add(str)
        }
    }

    days.forEach {
        println()
//        println("-" * 20)
        it.forEach {
            print(it)
            print("\t")
        }
    }
//    lines.forEach {
//        list.add(it)
//        println(it)
//    }

//    println(lines)
}

private operator fun String.times(i: Int): String {
    return StringBuilder().also { sb ->
        (0 until i).forEach {
            sb.append(this)
        }
    }.toString()
}
